
 
 F u n c t i o n :   q u e r y ( s t r i n g C S S S e l e c t o r O r N o d e A r r a y ,   f u n c t i o n F i l t e r C a l l b a c k ( k e y ,   v a l u e ) ) 
 
 
 
 D e s c r i p t i o n :   P r o c e s s e s   a   f i l t e r e d   l i s t   o f   m a t c h i n g   e l e m e n t s   a n d   r e t u r n s   a n   a r r a y   o f   n o d e s . 
 
 
 
 R e t u r n s :   f i l t e r e d   A r r a y . 
 
 
 
 N o t e :   T h e   q u e r y ( )   f u n c t i o n   w i l l   a l w a y s   r e t u r n   a n   a r r a y ,   e v e n   w h e n   e m p t y . 
 
 
 
 T h e   c a l l b a c k   f u n c t i o n   t h a t   e x e c u t e s   o n   e v e r y   o b j e c t   i n   t h e   a r r a y   a l s o   a c t s   a s   a   f i l t e r .   B y   r e t u r n i n g   f a l s e   f r o m   t h e   c a l l b a c k ,   i t   w i l l   p r e v e n t   t h a t   o b j e c t   f r o m   b e i n g   r e t u r n e d   a s   p a r t   o f   t h e   f i n a l   a r r a y   r e t u r n e d   f r o m   t h e   D C . q u e r y ( )   f u n c t i o n . 
 
 
 
 E x a m p l e : 
 
 
 
 / /   G e t   a n   a r r a y   o f   m a t c h i n g   e l e m e n t s   w i t h i n   t h e   D C   o b j e c t   c o n t a i n e r . 
 
 v a r   m y A r r a y   =   D C . q u e r y ( " h 1 ,   h 2 ,   h 3 " ) ; 
 
 
 
 / /   P r o c e s s   a n   a r r a y   o f   e l e m e n t s   w i t h i n   t h e   D C   o b j e c t   c o n t a i n e r . 
 
 v a r   m y A r r a y   =   D C . q u e r y ( " b u t t o n . t o g g l e " ,   f u n c t i o n ( i n d e x ,   o b j e c t )   { 
 
     / /   D o   s o m e t h i n g   w i t h   e a c h   o b j e c t . 
 
 } ) ; 
 
 
 
 / /   P r o c e s s   a n   a r r a y   o f   e l e m e n t s   a n d   f i l t e r   s p e c i f i c   o b j e c t s   s o   t h e y   a r e   n o t   r e t u r n e d   a s   p a r t   o f   t h e   f i n a l   a r r a y . 
 
 v a r   m y A r r a y   =   D C . q u e r y ( " b u t t o n . t o g g l e " ,   f u n c t i o n ( i n d e x ,   e l e m e n t )   { 
 
     / /   P r e v e n t   d i s a b l e d   b u t t o n s   f r o m   b e i n g   a d d e d   t o   m y A r r a y   w h e n   r e t u r n e d . 
 
     r e t u r n   ( e l e m e n t . d i s a b l e d )   ?   f a l s e   :   t r u e ; 
 
 } ) ; 
 
 